package com.tripwego.client.ui.widget.activite;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DisclosurePanel;
import com.tripwego.client.model.ActiviteModel;
import com.tripwego.client.ui.pageVoyage.IVoyageView;

public class ActiviteWidget extends Composite implements IVoyageView {

	private Presenter presenter;

	private EventBus eventBus;
	
	/*
	 * Elements graphiques
	 */
	private DisclosurePanel viewPanel = new DisclosurePanel();

	private ActiviteHeaderWidget header;

	//private ActiviteContentWidget content = new ActiviteContentWidget();

	/**
	 * 
	 */
	public ActiviteWidget(ActiviteModel activiteModel) {
		super();

		header = new ActiviteHeaderWidget(this, activiteModel);

		viewPanel.removeStyleDependentName("gwt-DisclosurePanel");
		viewPanel.removeStyleName("gwt-DisclosurePanel");
		viewPanel.setOpen(false);
		viewPanel.setAnimationEnabled(true);

		viewPanel.setHeader(header);
		header.setSize("100%", "1%");
//		viewPanel.setContent(content);
//		content.setSize("100%", "100%");

		initWidget(viewPanel);
	}

	@Override
	public void setPresenter(Presenter presenter) {
		this.presenter = presenter;
	}

	@Override
	public void setEventBus(EventBus eventBus) {
		this.eventBus = eventBus;
	}

	@Override
	public void init() {
		header.setPresenter(presenter);
		header.setEventBus(eventBus);
		header.init();
	}

}
